<script setup lang="ts">
defineProps<{ msg?: string }>();
const dots = ref("");
onMounted(() => {
  const interval = setInterval(() => {
    dots.value += ".";
    if (dots.value.length > 3)
      dots.value = "";
  }, 500);
  onBeforeUnmount(() => clearInterval(interval));
});
</script>

<template>
  <div class="flex h-full m-auto w-full">
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="1em"
      height="1em"
      viewBox="0 0 24 24"
    >
      <circle cx="18" cy="12" r="0" fill="currentColor">
        <animate
          attributeName="r"
          begin=".67"
          calcMode="spline"
          dur="1.5s"
          keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8"
          repeatCount="indefinite"
          values="0;2;0;0"
        />
      </circle>
      <circle cx="12" cy="12" r="0" fill="currentColor">
        <animate
          attributeName="r"
          begin=".33"
          calcMode="spline"
          dur="1.5s"
          keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8"
          repeatCount="indefinite"
          values="0;2;0;0"
        />
      </circle>
      <circle cx="6" cy="12" r="0" fill="currentColor">
        <animate
          attributeName="r"
          begin="0"
          calcMode="spline"
          dur="1.5s"
          keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8"
          repeatCount="indefinite"
          values="0;2;0;0"
        />
      </circle>
    </svg>
  </div>
</template>

<style scoped>
/* @import url("https://fonts.googleapis.com/css2?family=Inter&display=swap"); */

svg {
  font-family: Lato, sans-serif;
  width: 100%;
  height: 100%;
}

svg text {
  /* animation: stroke 2s infinite alternate; */
  stroke-width: 2;
  stroke: #365fa0;
  font-size: 100px;
}

@keyframes stroke {
  0% {
    fill: rgba(72, 138, 204, 0);
    stroke: rgba(54, 95, 160, 1);
    stroke-dashoffset: 25%;
    stroke-dasharray: 0 50%;
    stroke-width: 2;
  }

  30% {
    fill: rgba(72, 138, 204, 0);
    stroke: rgba(54, 95, 160, 1);
  }

  80% {
    fill: rgba(72, 138, 204, 0);
    stroke: rgba(54, 95, 160, 1);
    stroke-width: 3;
  }

  100% {
    fill: rgba(72, 138, 204, 1);
    stroke: rgba(54, 95, 160, 0);
    stroke-dashoffset: -25%;
    stroke-dasharray: 50% 0;
    stroke-width: 0;
  }
}

.wrapper {
  background-color: #ffffff;
}
</style>
